//
//  NSError+EV.h
//  EVClub
//
//  Created by sam on 14/11/19.
//  Copyright (c) 2014年 BitRice. All rights reserved.
//

#define kCFURLErrorFrameLoadInterrupted (102)

#define kEVError_Code (999999)
#define kError_UserInfo @"userInfo"

extern const NSInteger EVRevCodeAccoutExpired;
extern const NSInteger EVRevCodeNotExist;
extern const NSInteger EVRevCodeCollectSpotCheckStautsChanged;
extern const NSInteger EVRevCodeSpotDeleted;

extern const NSInteger EVRevCodePayFailure;//支付失败，实际上没发生支付，需重试
extern const NSInteger EVRevCodePayException;//支付异常，支付发生，但没成功，需人工介入
extern const NSInteger EVRevCodeRefundFailure;//退款失败，实际上没发生退款，需重试
extern const NSInteger EVRevCodeRefundException;//退款异常，退款发生，但没成功，需人工介入
extern const NSInteger EVRevCodeRefundNotPayed; //有未支付订单
extern const NSInteger EVRevCodeRefundCharging; //有充电中订单
extern const NSInteger EVRevCodeRefundOddOrder; //有异常订单

extern const NSInteger EVRevCodeStartChargingFailByRefunding; //开启充电失败 用户保证金退款中
extern const NSInteger EVRevCodeStartChargingFailByNotPayDeposit; //开启充电失败 用户没有缴纳保证金

#import <Foundation/Foundation.h>

@interface NSError (EV)

@property (nonatomic, readonly) NSInteger ev_revCode;
@property (nonatomic, readonly) NSString *ev_errorMessage;

+ (NSError *)ev_error:(NSString *)errorMessage;
+ (NSError *)ev_error:(NSString *)errorMessage revCode:(NSInteger)code;
+ (NSError *)ev_errorWithResponse:(NSDictionary *)responseDictionary;
+ (NSError *)ev_networkError;

- (BOOL)isEvError;
//- (NSString *)errorMessage;
- (BOOL)isNetworkError;

@end
